<#include "macro/layout.ftl" />
<@layout title="编辑文章">
<link rel="stylesheet" href="${request.contextPath}/editor.md-1.5.0/css/editormd.min.css">
<div class="row">

    <div class="col-md-10 col-md-offset-1">
        <div class="page-header">
            <h4>编辑文章</h4>
        </div>
        <br>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-12">
                    <input type="text" class="form-control" id="content" placeholder="请填写文章标题">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <textarea class="form-control" id="summary" placeholder="文章简要介绍"></textarea>
                </div>
            </div>
            <hr>
            <div class="form-group">
                <div class="col-sm-12" id="content-editor">
                    <textarea class="form-control" style="display: none" id="content" placeholder="文章内容">
                    </textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="tags" class="col-sm-2 control-label">标签</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="tags" placeholder="请输入关键词，用逗号分开">
                </div>
            </div>
            <div class="form-group">
                <label for="tags" class="col-sm-2 control-label">文章分类</label>
                <div class="col-sm-10">
                    <select class="form-control">
                        <option>JAVA</option>
                        <option>RAX</option>
                        <option>前端</option>
                        <option>业务</option>
                    </select>
                </div>
            </div>
            <div class="form-group checkbox">
                <label for="allowComment" class="col-sm-2 control-label">允许评论</label>
                <div class="col-sm-10">
                    <input type="checkbox">
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-6">
                    <button type="submit" class="center-block btn btn-lg btn-success"><i class="fa fa-paper-plane-o"></i>发布</button>
                </div>
            </div>

        </form>
    </div>
</div>
</@layout>
<script src="${request.contextPath}/editor.md-1.5.0/editormd.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var editor;
    $(function() {
    <#--editor = editormd("content-editor", {-->
    <#--width   : "100%",-->
    <#--height  : 400,-->
    <#--syncScrolling : "single",-->
    <#--autoHeight : true,-->
    <#--codeFold : true,-->
    <#--htmlDecode : true,-->
    <#--tex : true,-->
    <#--taskList : true,-->
    <#--emoji : true,-->
    <#--flowChart : true,-->
    <#--sequenceDiagram : true,-->
    <#--path    : "${request.contextPath}/editor.md-1.5.0/lib/"-->
    <#--});-->
        $.get("${request.contextPath}/test.md", function (md) {
            testEditor = editormd("content-editor", {
                markdown: "#### Setting\r\n\r\n    {\n        codeFold : true\n    }\r\n\r\n" + md,
                width: "100%",
                height: 600,
                syncScrolling : "single",
                autoHeight : true,
                codeFold: true,
                htmlDecode: true,
                tex: true,
                taskList: true,
                emoji: true,
                flowChart: true,
                sequenceDiagram: true,
                path: '${request.contextPath}/editor.md-1.5.0/lib/'
            });

        });
    });

</script>